Skip to content

#37 Migrate build system away from Ant (WIP) #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from

Conversation

PatrickSauts
Copy link
Contributor

Fixed #37 (at least to a large extent).

The tests can be run with mvn clean test
or with ant, I kept it compatible.

And also with the right settings.xml in your ~/.m2 directory like

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
    <server>
      <id>sonatype-nexus-staging</id>
      <username>my_login</username>
      <password>my_password</password>
    </server>
  </servers>
</settings>

you can run mvn clean deploy that would compile, run the tests, and deploy to the repository if the tests pass.

I also added maven version plugin, so to set a version you can do it that way
mvn versions:set -DnewVersion=<new.version> && mvn versions:commit

That's a better alternative than the release plugin.
So basically to release a new version the maven command would be:
mvn versions:set -DnewVersion=<new.version> && mvn versions:commit && mvn clean deploy

@michaelklishin michaelklishin self-assigned this Dec 22, 2015
@michaelklishin michaelklishin changed the title #37 Migrate build system away from Ant @michaelklishin #37 Migrate build system away from Ant (WIP) Dec 22, 2015
@michaelklishin
Copy link
Contributor

Thank you, I will take a look in the next few days.

@michaelklishin michaelklishin added this to the n/a milestone Dec 23, 2015
@PatrickSauts
Copy link
Contributor Author

You're welcome. Let me know if there is anything to fix and anything else I can do.

@PatrickSauts
Copy link
Contributor Author

By the way you can also run the perf tests like this
mvn -q exec:java -Dexec.classpathScope=test -Dexec.mainClass="com.rabbitmq.examples.PerfTest"

or with arguments

mvn -q exec:java -Dexec.classpathScope=test -Dexec.mainClass="com.rabbitmq.examples.PerfTest" -Dexec.args="arg0 arg1 arg2" 

Basically any class with a main inside package com.rabbitmq.examples without the need to moving any jar around, the classpath is defined by maven.

I added a runperftestMaven.sh and stresspersisterMaven.sh inside the script folder.

@michaelklishin
Copy link
Contributor

I cannot run tests with ant, ant test-client, ant test-functional, and ant test-suite all fail with

ant test-client
Buildfile: /Users/antares/Development/RabbitMQ/umbrella.git/deps/rabbitmq_java_client/build.xml

test-prepare:

test-build:

amqp-generate-check:

amqp-generate:

build:

BUILD FAILED
/Users/antares/Development/RabbitMQ/umbrella.git/deps/rabbitmq_java_client/build.xml:192: The following error occurred while executing this line:
/Users/antares/Development/RabbitMQ/umbrella.git/deps/rabbitmq_java_client/build.xml:85: Warning: Could not find file /Users/antares/Development/RabbitMQ/umbrella.git/deps/rabbitmq_java_client/src/com/rabbitmq/client/impl/ClientVersion.java.in to copy.

In fact, all ant tasks seems to fail the same way.

I've merged master into your branch and pushed it as rabbitmq-java-client-37, please rebase your master to it and (force) push.

@michaelklishin
Copy link
Contributor

Standard Maven tasks (test, package, clean) work well.

@michaelklishin
Copy link
Contributor

Plus one TLS test consistently errors. There are no failures in master with ant test-suite.

@PatrickSauts
Copy link
Contributor Author

I'll have a look tomorrow. I believe the pb with ant is that it's not using
the right path to find the files.

For the TLS problem I don't really know, what is the error ? I'll try to
reproduce it.

On Sun, Jan 3, 2016 at 5:16 AM, Michael Klishin [email protected]
wrote:

Plus one TLS test consistently errors. There are no failures in master
with ant test-suite.


Reply to this email directly or view it on GitHub
#119 (comment)
.

@michaelklishin
Copy link
Contributor

@PatrickSauts thank you. I will dig for details on the TLS test failure in a bit.

@PatrickSauts
Copy link
Contributor Author

The problem was that I had the generated sources so it didn't try to recreate them.

Fixed that part in build.xml and added calling the ant task amqp-generate inside the pom.xml

So running mvn generate-sources will also generate the source code using the ant build.xml file

That generate-sources is a phase called before compile so if needed mvn test or mvn compile ... will generate the code

@PatrickSauts
Copy link
Contributor Author

Still don't know about TLS as I'm getting that error on FunctionalTests

command: ../rabbit/scripts/rabbitmqctl list_connections -q pid peer_port

stdout:
{"init terminating in do_boot",{undef,[{rabbit_control_main,start,[],[]},{init,start_it,1,[]},{init,start_em,1,[]}]}}

@PatrickSauts
Copy link
Contributor Author

The tests pass for me when not under umbrella.
The first time I had to clean mnesia.
I launched them 5 times and everything is fine.
Is rabbitmqctl is used to clean the brokers after the tests?

Results :

Tests run: 299, Failures: 0, Errors: 0, Skipped: 0

@PatrickSauts
Copy link
Contributor Author

I pushed another version of the pom.xml that still uses ant but without the need for the build.xml file.
also line 132 the version could come from the pom version instead of the build.properties

@michaelklishin
Copy link
Contributor

Thank you @PatrickSauts, will give it another try today.

@michaelklishin
Copy link
Contributor

I updated rabbitmq-java-client-37. Now I have several test failures with ant test-functional:

Testcase: testRestartingExpiry took 0.035 sec
    Caused an ERROR
null
java.lang.ExceptionInInitializerError
    at com.rabbitmq.client.test.BrokerTestCase.bareRestart(Unknown Source)
    at com.rabbitmq.client.test.BrokerTestCase.restart(Unknown Source)
    at com.rabbitmq.client.test.functional.PerMessageTTL.testRestartingExpiry(Unknown Source)
Caused by: java.lang.NullPointerException
    at java.util.Properties$LineReader.readLine(Properties.java:434)
    at java.util.Properties.load0(Properties.java:353)
    at java.util.Properties.load(Properties.java:341)
    at com.rabbitmq.tools.Host.<clinit>(Unknown Source)

Testcase: testExpiryWhenConsumerIsLateToTheParty took 0.009 sec
    Caused an ERROR
null
java.io.IOException
    at com.rabbitmq.client.impl.AMQChannel.wrap(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.wrap(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.queueDeclare(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.queueDeclare(Unknown Source)
    at com.rabbitmq.client.test.functional.PerMessageTTL.declareQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.declareQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.declareAndBindQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.PerMessageTTL.testExpiryWhenConsumerIsLateToTheParty(Unknown Source)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'queue.ttl' in vhost '/': received 'false' but current is 'true', class-id=50, method-id=10)
    at com.rabbitmq.utility.ValueOrException.getValue(Unknown Source)
    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.privateRpc(Unknown Source)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'queue.ttl' in vhost '/': received 'false' but current is 'true', class-id=50, method-id=10)
    at com.rabbitmq.client.impl.ChannelN.asyncShutdown(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.processAsync(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.handleFrame(Unknown Source)
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)

Testcase: testPublishAndGetWithExpiry took 0.01 sec
    Caused an ERROR
null
java.io.IOException
    at com.rabbitmq.client.impl.AMQChannel.wrap(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.wrap(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.queueDeclare(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.queueDeclare(Unknown Source)
    at com.rabbitmq.client.test.functional.PerMessageTTL.declareQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.declareQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.declareAndBindQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.testPublishAndGetWithExpiry(Unknown Source)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'queue.ttl' in vhost '/': received 'false' but current is 'true', class-id=50, method-id=10)
    at com.rabbitmq.utility.ValueOrException.getValue(Unknown Source)
    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.privateRpc(Unknown Source)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'queue.ttl' in vhost '/': received 'false' but current is 'true', class-id=50, method-id=10)
    at com.rabbitmq.client.impl.ChannelN.asyncShutdown(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.processAsync(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.handleFrame(Unknown Source)
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)

Testcase: testExpiryWithReQueueAfterConsume took 0.009 sec
    Caused an ERROR
null
java.io.IOException
    at com.rabbitmq.client.impl.AMQChannel.wrap(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.wrap(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.queueDeclare(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.queueDeclare(Unknown Source)
    at com.rabbitmq.client.test.functional.PerMessageTTL.declareQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.declareQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.declareAndBindQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.testExpiryWithReQueueAfterConsume(Unknown Source)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'queue.ttl' in vhost '/': received 'false' but current is 'true', class-id=50, method-id=10)
    at com.rabbitmq.utility.ValueOrException.getValue(Unknown Source)
    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.privateRpc(Unknown Source)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'queue.ttl' in vhost '/': received 'false' but current is 'true', class-id=50, method-id=10)
    at com.rabbitmq.client.impl.ChannelN.asyncShutdown(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.processAsync(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.handleFrame(Unknown Source)
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)

Testcase: testExpiryWithRequeue took 0.008 sec
    Caused an ERROR
null
java.io.IOException
    at com.rabbitmq.client.impl.AMQChannel.wrap(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.wrap(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.queueDeclare(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.queueDeclare(Unknown Source)
    at com.rabbitmq.client.test.functional.PerMessageTTL.declareQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.declareQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.declareAndBindQueue(Unknown Source)
    at com.rabbitmq.client.test.functional.TTLHandling.testExpiryWithRequeue(Unknown Source)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'queue.ttl' in vhost '/': received 'false' but current is 'true', class-id=50, method-id=10)
    at com.rabbitmq.utility.ValueOrException.getValue(Unknown Source)
    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.privateRpc(Unknown Source)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for queue 'queue.ttl' in vhost '/': received 'false' but current is 'true', class-id=50, method-id=10)
    at com.rabbitmq.client.impl.ChannelN.asyncShutdown(Unknown Source)
    at com.rabbitmq.client.impl.ChannelN.processAsync(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(Unknown Source)
    at com.rabbitmq.client.impl.AMQChannel.handleFrame(Unknown Source)
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:745)

Testcase: testTTLAllowZero took 0.009 sec
    FAILED
Should be able to set ttl to zero
junit.framework.AssertionFailedError: Should be able to set ttl to zero
    at com.rabbitmq.client.test.functional.TTLHandling.testTTLAllowZero(Unknown Source)

I suspect that those may be using rabbitqmctl and the path to it is not calculated correctly? I did wipe $TMPDIR/rabbit* between runs.

@PatrickSauts
Copy link
Contributor Author

Thank you, That should be usefull. I'll have a look tomorrow.

@PatrickSauts
Copy link
Contributor Author

There was a NPE when initializing Host.java that should fix the java.lang.ExceptionInInitializerError

Looking into the other errors if I can reproduce them.

Also added cleaning of generated source on mvn clean so mvn clean test would regenerate the sources before running the tests.

@michaelklishin
Copy link
Contributor

OK, ant test-functional now passes, as does ant test-suite. I have submitted a new PR, #122, from rabbitmq-java-client-37 and we'll verify what else may need changing to be backwards compatible with our build system (probably not much).

@PatrickSauts please base all new changes on rabbitmq-java-client-37 and lets continue this discussion in #122. Thank you very much for your contributions to date!

@PatrickSauts
Copy link
Contributor Author

I tried to push the other day to branch rabbitmq-java-client-37 but
apparently I didn't have write access that's why I pushed into my fork
instead. Do I have write access to that branch now ? Actually is there
anything that needs to be done on that branch ?

On Thu, Jan 7, 2016 at 4:20 PM, Michael Klishin [email protected]
wrote:

Closed #119 #119.


Reply to this email directly or view it on GitHub
#119 (comment)
.

@michaelklishin
Copy link
Contributor

@PatrickSauts we'll keep you posted on what might need to be done there. So far things are looking good.

You don't have access to our repo. You can, however, create a new branch (with the same name), push it to your repo, and I'll pull it like I do with your master branch right now. Key difference is what branch you base your changes on. What branch you push to in your repo is up to you, we can pull in anything ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants